Skip to content

feat(calm-hub-ui): Visualise patterns#2169

Merged
YoofiTT96 merged 27 commits intofinos:mainfrom
YoofiTT96:viz-patterns
Mar 4, 2026
Merged

feat(calm-hub-ui): Visualise patterns#2169
YoofiTT96 merged 27 commits intofinos:mainfrom
YoofiTT96:viz-patterns

Conversation

@YoofiTT96
Copy link
Member

@YoofiTT96 YoofiTT96 commented Feb 25, 2026

Description

  • Addresses CalmHub Visualize Patterns #1632
  • Add pattern visualization support: CALM patterns (JSON Schema) are now rendered as interactive ReactFlow graphs, with nodes extracted from const values and oneOf/anyOf choices shown as decision groups
  • Add graph search & filter: both architecture and pattern graphs include a search bar (top-right overlay) that highlights matching nodes by name, ID, or type, with a node-type dropdown filter
  • Add decision filter to filter decision options on a pattern

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🎨 Code style/formatting changes
  • ♻️ Refactoring (no functional changes)
  • ⚡ Performance improvements
  • ✅ Test additions or updates
  • 🔧 Chore (maintenance, dependencies, CI, etc.)

Affected Components

  • CLI (cli/)
  • Shared (shared/)
  • CALM Widgets (calm-widgets/)
  • CALM Hub (calm-hub/)
  • CALM Hub UI (calm-hub-ui/)
  • Documentation (docs/)
  • VS Code Extension (calm-plugins/vscode/)
  • Dependencies
  • CI/CD

Commit Message Format ✅

Testing

  • I have tested my changes locally
  • I have added/updated unit tests
  • All existing tests pass

Checklist

  • My commits follow the conventional commit format
  • I have updated documentation if necessary
  • I have added tests for my changes (if applicable)
  • My changes follow the project's coding standards

@YoofiTT96 YoofiTT96 requested a review from a team as a code owner February 25, 2026 22:45
@YoofiTT96
Copy link
Member Author

YoofiTT96 commented Feb 25, 2026

Screen.Recording.2026-02-26.at.8.03.47.PM.mov

@YoofiTT96 YoofiTT96 changed the title Viz patterns feat(calm-hub-ui): Visualise patterns Feb 25, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive pattern visualization support to the CALM Hub UI, enabling users to visualize CALM patterns (JSON Schema) as interactive ReactFlow graphs alongside the existing architecture visualization. The implementation extracts nodes from pattern schema const values and renders oneOf/anyOf choices as visual decision groups. Additionally, a unified search and filter feature is introduced for both architecture and pattern graphs, allowing users to search nodes by name, ID, or type, with a dropdown filter for node types. Non-matching elements are dimmed to aid navigation in complex diagrams.

Changes:

  • Pattern visualization: New components (PatternGraph, PatternVisualizer, DecisionGroupNode, PatternDrawer, PatternSection) parse JSON Schema patterns into interactive graphs with decision groups for alternative choices
  • Search & filter: Unified SearchBar component with text search and type filtering added to both ArchitectureGraph and PatternGraph, using shared searchUtils for consistent behavior
  • Contract updates: NodeData and EdgeData interfaces updated to use CALM schema field names ('unique-id', 'node-type', 'relationship-type') for consistency between architectures and patterns

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
calm-hub-ui/src/visualizer/contracts/contracts.ts Updated NodeData and EdgeData to use CALM schema field names ('unique-id', 'node-type', 'relationship-type')
calm-hub-ui/src/visualizer/components/sidebar/Sidebar.tsx Updated type guards to check for new field names
calm-hub-ui/src/visualizer/components/sidebar/Sidebar.test.tsx Updated test mocks to use new field names
calm-hub-ui/src/visualizer/components/reactflow/utils/searchUtils.ts New utility functions for node/edge search and filtering (supports both architecture and pattern nodes)
calm-hub-ui/src/visualizer/components/reactflow/utils/searchUtils.test.ts Comprehensive test coverage for search utilities
calm-hub-ui/src/visualizer/components/reactflow/utils/patternTransformer.ts Core pattern parser: extracts nodes, relationships, controls, and interfaces from JSON Schema, handles oneOf/anyOf decision groups
calm-hub-ui/src/visualizer/components/reactflow/utils/patternTransformer.test.ts Extensive test coverage for pattern transformation including decision groups, relationships, and controls
calm-hub-ui/src/visualizer/components/reactflow/utils/patternClickHandlers.ts Converts ReactFlow node/edge data to sidebar-compatible format by stripping display artifacts
calm-hub-ui/src/visualizer/components/reactflow/utils/layoutUtils.ts Extracted calculateGroupBounds function for reuse in both ArchitectureGraph and PatternGraph
calm-hub-ui/src/visualizer/components/reactflow/theme.ts Added decision colors for oneOf/anyOf pattern visualization
calm-hub-ui/src/visualizer/components/reactflow/SearchBar.tsx Reusable search bar component with text input, clear button, and type filter dropdown
calm-hub-ui/src/visualizer/components/reactflow/SearchBar.test.tsx Test coverage for SearchBar component
calm-hub-ui/src/visualizer/components/reactflow/PatternVisualizer.tsx Top-level pattern visualizer component with background click handling
calm-hub-ui/src/visualizer/components/reactflow/PatternGraph.tsx ReactFlow graph for patterns with search/filter, node dragging, and group bound recalculation
calm-hub-ui/src/visualizer/components/reactflow/DecisionGroupNode.tsx Custom node for displaying oneOf/anyOf decision groups with styled borders and labels
calm-hub-ui/src/visualizer/components/reactflow/ArchitectureGraph.tsx Added search/filter integration and extracted calculateGroupBounds to layoutUtils
calm-hub-ui/src/visualizer/components/drawer/PatternDrawer.tsx Drawer component specifically for pattern visualization with sidebar integration
calm-hub-ui/src/visualizer/components/drawer/Drawer.tsx Updated to detect and handle both architecture and pattern data with pattern-specific click handlers
calm-hub-ui/src/theme/colors.ts Added decision color palette (yellow for oneOf, sky blue for anyOf)
calm-hub-ui/src/hub/components/pattern-section/PatternSection.tsx Hub section for patterns with diagram/JSON tabs
calm-hub-ui/src/hub/Hub.tsx Added PatternSection routing for calmType === 'Patterns'
calm-hub-ui/src/hub/Hub.test.tsx Updated tests to expect PatternSection instead of generic JSON renderer
calm-hub-ui/README.md Added future features roadmap section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@rocketstack-matt rocketstack-matt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing tests for:

  • PatternDrawer
  • PatternVisualizer
  • DecisionGroupNode
  • PatternSection

@YoofiTT96
Copy link
Member Author

  • PatternVisualizer

We're missing tests for:

  • PatternDrawer
  • PatternVisualizer
  • DecisionGroupNode
  • PatternSection

DecisionGroupNode, PatternVisualizer are pure presentation elements covered in other tests
PatternSection and PatternDrawer have been removed

@YoofiTT96 YoofiTT96 merged commit 5a163d0 into finos:main Mar 4, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants